package com.probiz.estore.common.model.content.base;

import java.io.Serializable;
import com.probiz.estore.Constants;
import com.probiz.estore.core.model.BaseObject;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * ContentStat Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class ContentStatTbl extends BaseObject implements Serializable {

    protected Integer contentStatId;
	protected Integer viewCount;
	protected Integer version;

	protected java.util.Set contents = new java.util.HashSet();

	/**
	 * Default Empty Constructor for class ContentStat
	 */
	public ContentStatTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class ContentStat
	 */
	public ContentStatTbl (
		 Integer in_contentStatId
        ) {
		this.setContentStatId(in_contentStatId);
    }


	public java.util.Set getContents () {
		return contents;
	}	
	
	public void setContents (java.util.Set in_contents) {
		this.contents = in_contents;
	}
    

	/**
	 * 	 * @return Integer
     * @hibernate.id column="contentStatId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getContentStatId() {
		return this.contentStatId;
	}
	
	/**
	 * Set the contentStatId
	 */	
	public void setContentStatId(Integer aValue) {
		this.contentStatId = aValue;
	}	

	/**
	 * 文章点击数	 * @return Integer
	 * @hibernate.property column="viewCount" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getViewCount() {
		return this.viewCount;
	}
	
	/**
	 * Set the viewCount
	 * @spring.validator type="required"
	 */	
	public void setViewCount(Integer aValue) {
		this.viewCount = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof ContentStatTbl)) {
			return false;
		}
		ContentStatTbl rhs = (ContentStatTbl) object;
		return new EqualsBuilder()
				.append(this.contentStatId, rhs.contentStatId)
				.append(this.viewCount, rhs.viewCount)
				.append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.contentStatId) 
				.append(this.viewCount) 
				.append(this.version) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("contentStatId", this.contentStatId) 
				.append("viewCount", this.viewCount) 
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "contentStatId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return contentStatId;
	}

}